.chessboard {
  width: 100%;
  aspect-ratio: 1;
  max-width: 600px;
  margin: 0 auto;
  padding: 10px;
  box-sizing: border-box;
}

.board-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  border: 2px solid #8b4513;
  border-radius: 4px;
  overflow: hidden;
}

.row {
  display: flex;
  flex: 1;
}

.square {
  flex: 1;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  will-change: transform;
}

.square--white {
  background-color: #f0d9b5;
}

.square--black {
  background-color: #b58863;
}

.square-selected-highlight {
  background-color: rgba(123, 97, 255, 0.4) !important;
}

.square--possible {
  position: relative;
}

.square--possible:hover {
  background-color: rgba(0, 255, 0, 0.2);
}

.piece {
  width: 85%;
  height: 85%;
  object-fit: contain;
  pointer-events: none;
  will-change: transform;
  backface-visibility: hidden;
}

.possible-move-indicator {
  position: absolute;
  width: 25%;
  height: 25%;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

.king-check-alert {
  position: absolute;
  width: 100%;
  height: 100%;
  border: 3px solid rgba(255, 0, 0, 0.7);
  box-sizing: border-box;
}

.piece {
  width: 85%;
  height: 85%;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.piece-moving {
  animation: piece-move 0.3s ease-in-out;
}

.piece-capturing {
  animation: piece-capture 0.4s ease-out forwards;
}

.piece-checked {
  animation: piece-check 0.5s ease-in-out infinite;
}

.piece-promoting {
  animation: piece-promote 0.5s ease-in-out;
}

@keyframes piece-move {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

@keyframes piece-capture {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: rotate(15deg) scale(0.8); opacity: 0.5; }
  100% { transform: scale(0); opacity: 0; }
}

@keyframes piece-check {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

@keyframes piece-promote {
  0% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-15px) scale(1.2); }
  100% { transform: translateY(0) scale(1); }
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}